﻿using System.Collections.Generic;

namespace OpenLightGroup.Common.UserManagement.Web
{
    using System.ComponentModel.DataAnnotations;
    using System.Collections.ObjectModel;
 
    /// <summary>
    /// Class containing the values and validation rules for user registration.
    /// </summary>
    public sealed partial class UserRegistration : User
    {
        ///// <summary>
        ///// Gets and sets the user name.
        ///// </summary>
        //[Key]
        //[Required(ErrorMessage="Username is required")]
        //[Display(Order = 0, Name = "Username")]
        //[RegularExpression("^[a-zA-Z0-9_]*$", ErrorMessage = "Invalid user name. It must contain only alphanumeric characters")]
        //[StringLength(255, MinimumLength = 4, ErrorMessage = "The user name must be at least 4 and at most 255 characters long")]
        //[Editable(true)]
        //public string UserName { get; set; }

        ///// <summary>
        ///// Gets and sets the email address.
        ///// </summary>
        //[Key]
        //[Required(ErrorMessage="Email is required")]
        //[Display(Order = 2, Name = "Email")]
        //[RegularExpression(@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$",
        //                   ErrorMessage="Invalid email. An email must use the format user@company.com")]
        //[Editable(true)]
        //public string Email { get; set; }


        [Required(ErrorMessage = "Password is required")]
        [RegularExpression("^.*[^a-zA-Z0-9].*$", ErrorMessage = "A password needs to contain at least one special character e.g. @ or #")]
        [StringLength(50, MinimumLength = 7, ErrorMessage = "Password must be at least 7 and at most 50 characters long")]
        public string Password { get; set; }


        /// <summary>
        /// Gets and sets the security question.
        /// </summary>
        [Required(ErrorMessage="Security question is required")]
        [Display(Order = 5, Name = "Security Question")]
        public string Question { get; set; }

        /// <summary>
        /// Gets and sets the answer to the security question.
        /// </summary>
        [Required(ErrorMessage = "Security answer is required")]
        [Display(Order = 6, Name = "Security Answer")]
        public string Answer { get; set; }

       // public IEnumerable<string> Roles { get; set; }

    }
}
